package cn.mw.cmdb.service.handler.monitorData;

import cn.mw.cmdb.enums.HistoryTypeEnum;
import cn.mw.cmdb.service.impl.CmdbServiceManage;
import cn.mw.main.api.common.ZabbixDubboService;

public class MonitorHistoryHandlerFactory {

    public static HistoryHandlerProcessor build(String type, CmdbServiceManage cmdbServiceManage, ZabbixDubboService zabbixDubboService) {
        HistoryTypeEnum historyType = HistoryTypeEnum.valueOf(type);
        HistoryHandlerProcessor proccessor = null;
        switch (historyType) {
            case History:
                proccessor = new MonitorHistoryHandler(cmdbServiceManage, zabbixDubboService);
                break;
            case LastValue:
                proccessor = new MonitorLastValueHandler(cmdbServiceManage, zabbixDubboService);
                break;
            case Trend:
                proccessor = new MonitorTrendHandler(cmdbServiceManage, zabbixDubboService);
                break;
        }
        return proccessor;
    }

}
